﻿@page "/diaryCardSetting"
@namespace SwashbucklerDiary.Rcl.Pages
@inherits ImportantComponentBase

<MyAppBar Title="@(I18n.T("Setting.Display.DiaryCard.Name"))"
          OnClick="NavigateToBack">
</MyAppBar>

<ScrollContainer>
    <MCard Class="list-item-card"
           Elevation="0"
           Rounded="@("lg")">
        <MList>
            <MListItem>
                <MListItemIcon>
                    <MIcon Class="evident-icon">
                        mdi-emoticon-happy-outline
                    </MIcon>
                </MListItemIcon>
                <MListItemContent>
                    @(I18n.T("Setting.Display.DiaryCard.Icon.Name"))
                </MListItemContent>
                <MListItemAction>
                    <MSwitch @bind-Value="diaryCardIcon"
                             TValue="bool"
                             OnChange="SettingChange(Setting.DiaryCardIcon)"
                             Dense="true"
                             Inset="true"
                             Color="white">
                    </MSwitch>
                </MListItemAction>
            </MListItem>

            <MDivider Class="mx-5"></MDivider>

            <MListItem OnClick="@(()=>showDiaryCardDateFormat=true)">
                <MListItemIcon>
                    <MIcon Class="evident-icon">
                        mdi-calendar-clock
                    </MIcon>
                </MListItemIcon>
                <MListItemContent>
                    @(I18n.T("Setting.Display.DiaryCard.DateFormat.Name"))
                </MListItemContent>
                <MListItemContent Class="setting-state">
                    <MListItemSubtitle>
                        @(I18n.T(DiaryCardDateFormatKey))
                    </MListItemSubtitle>
                </MListItemContent>
                <MListItemAction>
                    <MIcon>mdi-chevron-right</MIcon>
                </MListItemAction>
            </MListItem>
        </MList>
    </MCard>
</ScrollContainer>

<RadioDialog @bind-Value="diaryCardDateFormat"
             @bind-Visible="showDiaryCardDateFormat"
             Title="@(I18n.T("Setting.Display.DiaryCard.DateFormat.Name"))"
             TItemValue="string"
             TItem="KeyValuePair<string,string>"
             OnChange="DiaryCardDateFormatChanged"
             Items="diaryCardDateFormats">
</RadioDialog>
